﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Linq;
using CarBooker.Models;

namespace CarBooker.Repository
{
    public class HotelRepository : IGenericRepository<Hotel>
    {
        private Table<Hotel> hotelTable;

        public HotelRepository(string connection)
        {
            hotelTable = (new DataContext(connection)).GetTable<Hotel>();
        }

        public Hotel Get<Hotel>(int id)
        {
            throw new NotImplementedException();
        }

        public void Create<Hotel>(Hotel entityToCreate)
        {
            throw new NotImplementedException();
        }


        public void Edit<Hotel>(Hotel entityToEdit)
        {
            throw new NotImplementedException();
        }

        public void Delete<Hotel>(Hotel entityToDelete)
        {
            throw new NotImplementedException();
        }

       

        public Hotel Get(int id)
        {
            throw new NotImplementedException();
        }

        public void Create(Hotel entityToCreate)
        {
            throw new NotImplementedException();
        }

        public void Edit(Hotel entityToEdit)
        {
            throw new NotImplementedException();
        }

        public void Delete(Hotel entityToDelete)
        {
            throw new NotImplementedException();
        }
      
        public IQueryable<Hotel> Hotels()
        {
            return hotelTable;
            //throw new NotImplementedException();
        }

        //IQueryable<Hotel> IGenericRepository<Hotel>.List
        //{
        //    get { return hotelTable.ToList<Hotel>(); }
        //}

        List<Hotel> IGenericRepository<Hotel>.List
        {
            get { return hotelTable.ToList<Hotel>(); }
        }

        #region IGenericRepository<Hotel> Members


        Hotel IGenericRepository<Hotel>.Get(int id)
        {
            throw new NotImplementedException();
        }

        void IGenericRepository<Hotel>.Create(Hotel entityToCreate)
        {
            throw new NotImplementedException();
        }

        void IGenericRepository<Hotel>.Edit(Hotel entityToEdit)
        {
            throw new NotImplementedException();
        }

        void IGenericRepository<Hotel>.Delete(Hotel entityToDelete)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
